<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://www.jq22.com/jquery/jquery-3.3.1.js"></script>
</head>
<body>
<div class="list">
    <table id="customers" border="1">
        <thead>
        <tr>
            <td>cust_id</td>
            <td>cust_name</td>
            <td>cust_address</td>
            <td>cust_city</td>
            <td>cust_state</td>
            <td>cust_zip</td>
            <td>cust_country</td>
            <td>cust_contact</td>
            <td>cust_email</td>
        </tr>
        </thead>
        <tbody id="data">

        </tbody>
    </table>
</div>
</body>
</html>
<script>
    var str = '';
    $.ajax({
        // 相对路径会以上级controller的路径为根，也就是page
        // 最好使用绝对路径
        url: '/ssmdemo/customers',
        type: 'get',
        dataType: 'json',
        cache: false,
        success: function (res) {
            $.each(res, function (i, item) {
                str += '<tr>';
                str += '<td>' + item.custId + '</td>';
                str += '<td>' + item.custName + '</td>';
                str += '<td>' + item.custAddress + '</td>';
                str += '<td>' + item.custCity + '</td>';
                str += '<td>' + item.custState + '</td>';
                str += '<td>' + item.custZip + '</td>';
                str += '<td>' + item.custCountry + '</td>';
                str += '<td>' + item.custContact + '</td>';
                str += '<td>' + item.custEmail + '</td>';
                str += '</tr>';

            });
            $('#data').append(str)
        }
    });
</script>